<extend name="Layout/page_popup" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<select name="dept_list" id="dept_list" class="display-none">
		{:fill_option($dept_list)}
	</select>
	{:W('PageHeader/popup',array('name'=>'添加部门','search'=>'N'))}
	<!-- 列表显示区域  -->
	<div class="row">
		<div class="col-xs-12 sub_content">
			<form id="form_data" name="form_data" method="post" class="well form-horizontal clearfix">				
				<input type="hidden" name="opmode" id="opmode" value="add">
				<input type="hidden" name="pid" id="pid" value="">
				<div class="form-group col-xs-12">
					<label class="col-xs-3 control-label" for="dept_no">编码*：</label>
					<div class="col-xs-9">
						<input class="form-control" type="text" id="dept_no" name="dept_no" check="require" msg="请输入编码">
					</div>
				</div>
				<div class="form-group col-xs-12">
					<label class="col-xs-3 control-label" for="name">名称*：</label>
					<div class="col-xs-9">
						<input class="form-control" type="text" id="name" name="name" check="require" msg="请输入名称">
					</div>
				</div>
				<div class="form-group col-xs-12">
					<label class="col-xs-3 control-label" for="short">简称*：</label>
					<div class="col-xs-9">
						<input class="form-control" type="text" id="short" name="short" check="require" msg="请输入简称">
					</div>
				</div>
				<div class="form-group col-xs-12">
					<label class="col-xs-3 control-label" for="dept_grade_id">部门级别*：</label>
					<div class="col-xs-9">
						<select name="dept_grade_id" id="dept_grade_id" class="form-control" msg="请选择部门级别" check="require">
							<option>选择部门级别</option>
							{:fill_option($dept_grade_list)}
						</select>
					</div>
				</div>
				<div class="form-group col-xs-12">
					<label class="col-xs-3 control-label" for="sort">排序：</label>
					<div class="col-xs-9">
						<input class="form-control" type="text" id="sort" name="sort" >
					</div>
				</div>

				<div class="form-group col-xs-12">
					<label class="col-xs-3 control-label" for="is_del">状态*：</label>
					<div class="col-xs-9">
						<select   name="is_del" id="is_del" class="form-control">
							<option  value="0">启用</option>
							<option value="1">禁用</option>
						</select>
					</div>
				</div>
			</form>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		function save() {
			if (check_form("form_data")) {
				var vars = $("#form_data").serialize();
				sendAjax("{:U('save')}", vars, function(data) {
					if (data.status) {
						ui_alert(data.info, function() {
							parent.location.reload(true);
							myclose();
						});
					}
				});
			}
		}

		$(document).ready(function() {
			$pid = $("#id", parent.document).val();
			$("#pid").val($pid);
		});
	</script>

</block>